package thread.processing.performance;

import java.util.concurrent.TimeUnit;

public class WithoutThread {
	static int counter = 0;
	public static void main(String[] args) throws InterruptedException {
		
		long startTime = System.nanoTime();

		for (int i = 0; i < 10; i++) {
			Thread.sleep(1000);
			counter++;
		}
		long elapsedTime = System.nanoTime() - startTime;
		long seconds = TimeUnit.SECONDS.convert(elapsedTime,
				TimeUnit.NANOSECONDS);
		System.out.println("Time taken : " + seconds + " Seconds");
		System.out.println("Completed Tries : " + counter);
	}
}
